<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>wsgiwebapi.cpwsgiserver.HTTPRequest</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="wsgiwebapi-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="../index.html">WSGIWebAPI</a></th>
          </tr></table></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="wsgiwebapi-module.html">Package&nbsp;wsgiwebapi</a> ::
        <a href="wsgiwebapi.cpwsgiserver-module.html">Package&nbsp;cpwsgiserver</a> ::
        Class&nbsp;HTTPRequest
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="wsgiwebapi.cpwsgiserver.HTTPRequest-class.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<!-- ==================== CLASS DESCRIPTION ==================== -->
<h1 class="epydoc">Class HTTPRequest</h1><span class="codelink"><a href="wsgiwebapi.cpwsgiserver-pysrc.html#HTTPRequest">source&nbsp;code</a></span><br /><br />
<pre class="base-tree">
object --+
         |
        <strong class="uidshort">HTTPRequest</strong>
</pre>

<hr />
<pre class="literalblock">
An HTTP Request (and response).

A single HTTP connection may consist of multiple request/response pairs.

send: the 'send' method from the connection's socket object.
wsgi_app: the WSGI application to call.
environ: a partial WSGI environ (server and connection entries).
    The caller MUST set the following entries:
    * All wsgi.* entries, including .input
    * SERVER_NAME and SERVER_PORT
    * Any SSL_* entries
    * Any custom entries like REMOTE_ADDR and REMOTE_PORT
    * SERVER_SOFTWARE: the value to write in the &quot;Server&quot; response header.
    * ACTUAL_SERVER_PROTOCOL: the value to write in the Status-Line of
        the response. From RFC 2145: &quot;An HTTP server SHOULD send a
        response version equal to the highest version for which the
        server is at least conditionally compliant, and whose major
        version is less than or equal to the one received in the
        request.  An HTTP server MUST NOT send a version for which
        it is not at least conditionally compliant.&quot;

outheaders: a list of header tuples to write in the response.
ready: when True, the request has been parsed and is ready to begin
    generating the response. When False, signals the calling Connection
    that the response should not be generated and the connection should
    close.
close_connection: signals the calling Connection that the request
    should close. This does not imply an error! The client and/or
    server may each request that the connection be closed.
chunked_write: if True, output will be encoded with the &quot;chunked&quot;
    transfer-coding. This value is set automatically inside
    send_headers.

</pre><br /><br />

<!-- ==================== INSTANCE METHODS ==================== -->
<a name="section-InstanceMethods"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td align="left" colspan="2" class="table-header">
    <span class="table-header">Instance Methods</span></td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="wsgiwebapi.cpwsgiserver.HTTPRequest-class.html#__init__" class="summary-sig-name">__init__</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">wfile</span>,
        <span class="summary-sig-arg">environ</span>,
        <span class="summary-sig-arg">wsgi_app</span>)</span><br />
      x.__init__(...) initializes x; see x.__class__.__doc__ for 
      signature</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="wsgiwebapi.cpwsgiserver-pysrc.html#HTTPRequest.__init__">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="parse_request"></a><span class="summary-sig-name">parse_request</span>(<span class="summary-sig-arg">self</span>)</span><br />
      Parse the next HTTP request start-line and message-headers.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="wsgiwebapi.cpwsgiserver-pysrc.html#HTTPRequest.parse_request">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="read_headers"></a><span class="summary-sig-name">read_headers</span>(<span class="summary-sig-arg">self</span>)</span><br />
      Read header lines from the incoming stream.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="wsgiwebapi.cpwsgiserver-pysrc.html#HTTPRequest.read_headers">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="decode_chunked"></a><span class="summary-sig-name">decode_chunked</span>(<span class="summary-sig-arg">self</span>)</span><br />
      Decode the 'chunked' transfer coding.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="wsgiwebapi.cpwsgiserver-pysrc.html#HTTPRequest.decode_chunked">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="respond"></a><span class="summary-sig-name">respond</span>(<span class="summary-sig-arg">self</span>)</span><br />
      Call the appropriate WSGI app and write its iterable output.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="wsgiwebapi.cpwsgiserver-pysrc.html#HTTPRequest.respond">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="simple_response"></a><span class="summary-sig-name">simple_response</span>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">status</span>,
        <span class="summary-sig-arg">msg</span>=<span class="summary-sig-default">&quot;&quot;</span>)</span><br />
      Write a simple response back to the client.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="wsgiwebapi.cpwsgiserver-pysrc.html#HTTPRequest.simple_response">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="start_response"></a><span class="summary-sig-name">start_response</span>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">status</span>,
        <span class="summary-sig-arg">headers</span>,
        <span class="summary-sig-arg">exc_info</span>=<span class="summary-sig-default">None</span>)</span><br />
      WSGI callable to begin the HTTP response.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="wsgiwebapi.cpwsgiserver-pysrc.html#HTTPRequest.start_response">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="wsgiwebapi.cpwsgiserver.HTTPRequest-class.html#write" class="summary-sig-name">write</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">chunk</span>)</span><br />
      WSGI callable to write unbuffered data to the client.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="wsgiwebapi.cpwsgiserver-pysrc.html#HTTPRequest.write">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="send_headers"></a><span class="summary-sig-name">send_headers</span>(<span class="summary-sig-arg">self</span>)</span><br />
      Assert, process, and send the HTTP response message-headers.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="wsgiwebapi.cpwsgiserver-pysrc.html#HTTPRequest.send_headers">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
  <tr>
    <td colspan="2" class="summary">
    <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
      <code>__delattr__</code>,
      <code>__getattribute__</code>,
      <code>__hash__</code>,
      <code>__new__</code>,
      <code>__reduce__</code>,
      <code>__reduce_ex__</code>,
      <code>__repr__</code>,
      <code>__setattr__</code>,
      <code>__str__</code>
      </p>
    </td>
  </tr>
</table>
<!-- ==================== CLASS VARIABLES ==================== -->
<a name="section-ClassVariables"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td align="left" colspan="2" class="table-header">
    <span class="table-header">Class Variables</span></td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="max_request_header_size"></a><span class="summary-name">max_request_header_size</span> = <code title="0">0</code>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="max_request_body_size"></a><span class="summary-name">max_request_body_size</span> = <code title="0">0</code>
    </td>
  </tr>
</table>
<!-- ==================== PROPERTIES ==================== -->
<a name="section-Properties"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td align="left" colspan="2" class="table-header">
    <span class="table-header">Properties</span></td>
</tr>
  <tr>
    <td colspan="2" class="summary">
    <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
      <code>__class__</code>
      </p>
    </td>
  </tr>
</table>
<!-- ==================== METHOD DETAILS ==================== -->
<a name="section-MethodDetails"></a>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td align="left" colspan="2" class="table-header">
    <span class="table-header">Method Details</span></td>
</tr>
</table>
<a name="__init__"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">wfile</span>,
        <span class="sig-arg">environ</span>,
        <span class="sig-arg">wsgi_app</span>)</span>
    <br /><em class="fname">(Constructor)</em>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="wsgiwebapi.cpwsgiserver-pysrc.html#HTTPRequest.__init__">source&nbsp;code</a></span>&nbsp;
    </td>
  </table>
  
  x.__init__(...) initializes x; see x.__class__.__doc__ for 
  signature
  <dl class="fields">
    <dt>Overrides:
      object.__init__
        <dd><em class="note">(inherited documentation)</em></dd>
    </dt>
  </dl>
</td></tr></table>
</div>
<a name="write"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">write</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">chunk</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="wsgiwebapi.cpwsgiserver-pysrc.html#HTTPRequest.write">source&nbsp;code</a></span>&nbsp;
    </td>
  </table>
  
  <p>WSGI callable to write unbuffered data to the client.</p>
  This method is also used internally by start_response (to write data 
  from the iterable returned by the WSGI application).
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="wsgiwebapi-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="../index.html">WSGIWebAPI</a></th>
          </tr></table></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0beta1 on Tue Feb  3 09:21:34 2009
    </td>
    <td align="right" class="footer">
      <a href="http://epydoc.sourceforge.net">http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie()
  // -->
</script>
  
</body>
</html>
